package com.ssy.lingxi.product.repository;

import com.ssy.lingxi.product.entity.CommodityDraft;
import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;

import java.util.List;

/**
 * 商品草稿持久化层
 * @author jw.chen
 * @version 2.0.0
 * @date 2022/3/28
 */
public interface CommodityDraftRepository extends JpaRepository<CommodityDraft, Long>, JpaSpecificationExecutor<CommodityDraft> {
    Page<CommodityDraft> findByMemberIdAndMemberRoleIdOrderByIdDesc(Long memberId, Long memberRoleId, Pageable page);

    List<CommodityDraft> findByMemberIdAndMemberRoleIdAndIdIn(Long memberId, Long memberRoleId, List<Long> commodityDraftIdList);
}
